//
//  NewPreViewController.m
//  xingfugangwan
//
//  Created by rainday on 15/1/1.
//  Copyright (c) 2015年 rainday. All rights reserved.
//

#import "NewPreViewController.h"
#import "PreBookViewController.h"


#define CATEGORY @[@"结婚",@"回门",@"合办",@"生日",@"其他"]
@interface NewPreViewController ()<PreBookViewControllerProtocol>

- (IBAction)goPreOrder:(id)sender;

@end

@implementation NewPreViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.navigationItem.title = @"预约";
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (void)goPreOrder:(id)sender
{
    UIButton *button = (UIButton *)sender;
    PreBookViewController *preVC = [[PreBookViewController alloc] initWithNibName:@"PreBookViewController" bundle:nil category:[CATEGORY objectAtIndex:button.tag-7770]];
    preVC.delegate = self;
    [self.navigationController pushViewController:preVC animated:YES];
    

    
}

- (void)preBookViewController:(PreBookViewController *)preBookViewController didAddOrder:(NSString *)orderId
{
    [preBookViewController.navigationController popToRootViewControllerAnimated:YES];
    
}
@end
